package com.rdxer.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Builder;
import lombok.Data;
import lombok.experimental.Tolerate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;


/**
 * 账户表
 */
@Entity
@Data
@Builder
@Table
public class Account {
    @Id
    @Column(length = 100)
    private String id;

    @Column(length = 100)
    private String username;
    @JsonIgnore
    @Column(length = 100)
    private String password;
    @Column(length = 100)
    private String displayName;
    @Column(length = 100)
    private String email;
    @Column(length = 100)
    private String tel;
    @Column(length = 20)
    private String gender;

    @Column(length = 200)
    private String roles;


    @Column(length = 150)
    private String avatar;

    // 注册时间
    private Long createdDate;
    // 注销时间
    private Long disabledDate;


    // 最后一次登陆时间
    private Long lastLoginDate;
    // 最后一次更新时间
    private Long updateDate;
    // 入职时间
    private Long entryDate;


    @Tolerate
    public Account() {

    }

    public enum Role{
        admin,
        teacher,
        studen
    }
    public enum Gender{
        unknown,
        male,
        female,
    }
}
